package cn.sciento.farm.devicemanager.common.constant;

/**
 * @author wumu
 * @version V1.0
 * @date 3/7/18
 * @time 3:45 PM
 */
public interface RedisConstant {

    String BASE_PREFIX = "device_manager:";

    //认证
    String TOKEN_PREFIX = BASE_PREFIX + "TOKEN_PREFIX:";


    String CHANGE_PHONE_PREFIX = BASE_PREFIX + "change_phone_prefix:";
    String CHANGE_PHONE_USER_PREFIX = BASE_PREFIX + "change_phone_user_prefix:";
    String CHANGE_PHONE_SIXTY_PREFIX = BASE_PREFIX + "change_phone_sixty_prefix:";

    //策略相关的存储
    String STRATEGY_EXCEED_PREFIX = BASE_PREFIX + "strategy_exceed_prefix:";
    String STRATEGY_INTERVAL_PREFIX = BASE_PREFIX + "strategy_interval_prefix:";

    // 萤石云token
    String FLUORITE_ACCESS_TOKEN = BASE_PREFIX + "fluorite_access_token_";


    //缓存
    String CACHE = BASE_PREFIX + "cache:";
    String SIMPLE_CACHE = "simple:";
    String TENANT_CACHE = "tenant:";
    String COLLECTION_TYPE_CACHE = "collectionType:";
    String CAMERA_CACHE = "camera:";
    String COLLECTION_THRESHOLD_CACHE = "collectionThreshold:";
    String CONCENTRATOR_CACHE = "concentrator:";
    String LAND_CACHE = "land:";
    String AREA_CACHE = "area:";
    String DIST_REGION_CACHE = "distRegion:";
    String DEVICE_SWITCH_CACHE = "switch:";
    String SWITCH_TIMER_CACHE = "timer:";
    String TRIGGER_INTERVAL_PREFIX = BASE_PREFIX+"trigger:";
    long MINUTES_CACHE = 1800;
    // 流量限制
    String LIMIT_RATER = BASE_PREFIX+"rater:";
    String TOKEN_BUCKET = LIMIT_RATER+"bucket_";
    String TOKEN_BUCKET_COUNT = LIMIT_RATER+"bucket_count_";
    String TOKEN_BUCKET_MONITOR = LIMIT_RATER+"bucket_monitor_";

    // 创建的分布式锁
    String CREATE_COLLECTION = BASE_PREFIX +"createCollection:%s-%s-%s";
    String CREATE_CONTROLLER = BASE_PREFIX +"createController:%s-%s-%s";

}
